package com.csi.controller;

import com.csi.domain.UserBook;
import com.csi.service.UserBookService;
import com.csi.utils.JsonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userBook")
@Tag(name = "UserBook",description = "旅游套餐秒杀接口API")
public class UserBookController {

    @Autowired
    private UserBookService userBookService;

    @Operation(summary = "秒杀旅游套餐",description = "秒杀旅游套餐")
    @PostMapping("/save")
    public Object saveUserBook(@RequestBody UserBook userBook) {
        String status = userBookService.saveUserBook(userBook);
        return new JsonResult<>(status);
    }
}
